package com.hejl.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

import java.util.function.Function;

/**
 * @author Hejl
 * @version 1.0
 * @description
 * @className FunctionConfig
 * @date 2025/6/10 0:26
 */
@Configuration
public class FunctionConfig {
  public record AddFunction(int x,int y){}
    public record MulFunction(int x,int y){}
    @Bean
    @Description("加法")
    public Function<AddFunction,Integer> addFunction(){
        return addFunction -> addFunction.x + addFunction.y;
    }
    @Bean
    @Description("乘法")
    public Function<MulFunction,Integer> mulFunction(){
        return addFunction -> addFunction.x * addFunction.y;
    }
}